package dblayer;

import javax.jws.WebMethod;
import javax.jws.WebService;

@WebService()
public class DataWS {
	
	@WebMethod()
	public String register(String fname, String lname, String street,
			String city, String state, String zipcode, String username,
			String password, String email) {
		CustomerDAO customerDaoObj = CustomerDAO.getInstance();
		String result = customerDaoObj.register(fname, lname, street, city,
				state, zipcode, username, password, email);
		System.out.println(result);
		return result;
	}

	@WebMethod()
	public String checkUsernameExists(String username) {
		CustomerDAO customerDaoObj = CustomerDAO.getInstance();
		String result = customerDaoObj.checkUsernameExists(username);
		System.out.println(result);
		return result;
	}

	@WebMethod()
	public String authenticate(String username, String password) {
		CustomerDAO customerDaoObj = CustomerDAO.getInstance();
		String result = customerDaoObj.authenticate(username, password); 
		System.out.println(result);
		return result;
	}

	@WebMethod()
	public String createOrder(String username) {
		CustomerDAO customerDaoObj = CustomerDAO.getInstance();
		String result = customerDaoObj.createOrder(username); 
		System.out.println(result);
		return result;
	}

	@WebMethod()
	public String attachInvoice(String orderId, String invoiceId) {
		CustomerDAO customerDaoObj = CustomerDAO.getInstance();
		String result =customerDaoObj.attachInvoice(orderId, invoiceId); 
		System.out.println(result);
		return result;
	}


}
